<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title> {$action} | {:get_opinion('title')}</title>

    <include file="Public:head"/>

</head>
<body class="skin-blue">

{:W('Common/header')}

<div class="wrapper row-offcanvas row-offcanvas-left">
    {:W('Common/sideMenu')}


    <!-- Right side column. Contains the navbar and content of the page -->
    <aside class="right-side">
        <!-- Content Header (Page header) -->


        <section class="content-header">
            <h1>
                {$action}
                <small>{$Think.config.title}</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{$module_url}"><i class="fa fa-dashboard"></i> {$module}</a></li>
                <li class="active">{$action}</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">

            <div class="row">
                <div class="col-md-12">
                    <div class="box box-warning">
                        <div class="box-header">
                            <h3 class="box-title">{$action}</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">


                            <div class="col-md-3 margin">
                                <div class="btn-group">
                                    <a href="{:U('Admin/Posts/addCategory')}">
                                        <button id="sample_editable_1_new" class="btn btn-success">
                                            <i class="icon-plus"></i>添加新分类
                                        </button>
                                    </a>
                                </div>
                            </div>
                            <table class="table table-striped table-bordered table-hover"
                                   id="sample_1">
                                <thead>
                                <tr>
                                    <th style="width:8px;"><input type="checkbox"
                                                                  class="group-checkable"
                                                                  id="check-all"         data-set="#sample_1 .checkboxes"/></th>
                                    <th>名称</th>
                                    <th align="left" class="tree">结构</th>
                                    <th>父类</th>
                                    <th>查看</th>
                                    <th>操作</th>

                                </tr>
                                </thead>
                                <tbody>
                                <foreach name="category" item="v">
                                    <tr class="odd gradeX">
                                        <td style="width:8px;"><input type="checkbox" class="checkboxes" value="1"/>
                                        </td>
                                        <td><a href="{:U('Admin/Posts/editCategory', array('id' => $v['cat_id']))}"
                                               title="{$v.cat_name}">{$v.cat_name|mb_substr=0,30,"UTF-8"}</a></td>
                                        <td class="hidden-480"><a
                                                href="{:U('Admin/Posts/editCategory', array('id' => $v['cat_id']))}">{$v.cat_slug|mb_substr=0,30,"UTF-8"}</a>
                                        </td>
                                        <td>{$v['cat_father']['cat_name']|is_empty} &nbsp;</td>

                                        <td>
                                            <a class="btn btn-success"
                                               href="{:U('Admin/Posts/index', array('cat' => $v['cat_id']))}">查看分类文章</a>
                                        </td>
                                        <td>
                                            <a class="btn btn-primary"
                                               href="{:U('Admin/Posts/editCategory', array('id' => $v['cat_id']))}">编辑</a>
                                            <a onclick="javascript:return a_confirm()" class="btn btn-danger"
                                               href="{:U('Admin/Posts/delCategory', array('id' => $v['cat_id']))}">删除</a>

                                        </td>


                                    </tr>
                                </foreach>
                                </tbody>
                            </table>
                        </div>


                        </div>
                    </div>
                </div>
            </div>


        </section>
        <!-- /.content -->
    </aside>
    <!-- /.right-side -->
</div>
<!-- ./wrapper -->

<include file="Public:foot"/>

</body>
</html>